<!-- <script src="../js/jquery-3.6.0.min.js"></script> -->
@@include('../common.html')
<script src="../../assets/vendors/art-template/template-web.js"></script>
<script src="../../assets/vendors/moment/moment.js"></script>

<script src="../../assets/vendors/nprogress/nprogress.js"></script>
<script src="../../assets/vendors/bootstrap/js/bootstrap.js"></script>

<script src="../../assets/vendors/jquery/jquery.js"></script>
<script>
    //全局设置Token 为ajaxa
    $.ajaxSetup({
        beforeSend: function(xhr) {
            const token = localStorage.getItem('token');
            // console.log('token', token);
            xhr.setRequestHeader('Authorization', token);
        },
        timeout: 6000
    })
    $.ajax(`${baseUrl}/login/status`, {
        success: function(res) {
            // console.log('res', res);
            if (res.data.isLogin) {
                window.userId = res.data.userId;
            } else {
                alert('登录是啊比');
                location.href = 'login.html';
            }
        },
        error: function(err) {
            console.log('err', err);
            alert('登录是啊比');
            location.href = 'login.html';
        }
    })
</script>